package com.company.behavioral.command_pattern.demo1.concrete_command;

import com.company.behavioral.command_pattern.demo1.command.Command;
import com.company.behavioral.command_pattern.demo1.receiver.DisplayHelpClass;

/**
 * 帮助命令
 * @ClassName HelpCommand
 * @Author tiezheng.han
 * @Date 2020/9/2 16:18
 **/
public class HelpCommand extends Command {

    /**
     * 维持对请求接收者的引用
     */
    private DisplayHelpClass hcObj;

    public HelpCommand(){
        hcObj = new DisplayHelpClass();
    }

    /**
     * 命令执行方法，将调用请求接收者的业务方法
     */
    @Override
    public void execute() {
        hcObj.display();
    }
}
